
 function GetXmlHttp(){
	var A=null; 
	try { 
		A=new ActiveXObject("Msxml2.XMLHTTP"); 
	}catch(e){ 
		try{ 
			A=new ActiveXObject("Microsoft.XMLHTTP"); 
		}catch(oc){ 
			A=null;
		}
	} 
	if ( !A && typeof XMLHttpRequest != "undefined" ){ 
		A=new XMLHttpRequest() ;
	} 
	return A ;
}
function cofimstr(str){
	  if(!confirm(str)) return false;
	  return true;
}



function  CheckAll(form)      
{for  (var  i=0;i<form.elements.length;i++)      
{var  e  =  form.elements[i];      
if  (e.name  !=  'chkall' && e.type=='checkbox')      
	e.checked  =  form.chkall.checked;      
}      
}      


function fucCheckLength(strTemp)
{
 var i,sum;
 sum=0;
	 for(i=0;i<strTemp.length;i++)
	 {
	  if ((strTemp.charCodeAt(i)>=0) && (strTemp.charCodeAt(i)<=255))
	   sum=sum+1;
	  else
	   sum=sum+2;
	 }
 return sum;
}
var $=function($){return getElementById_s($);}
function getElementById_s(id){
	var obj = null;
	if(document.getElementById){
		obj = document.getElementById(id);
	}else if(document.all){
		obj = document.all[id];
	}
	return obj;
}




/*--debug--*/



function InOptions(Varoptions,VarVale){
	for(var Vi=0;Vi<Varoptions.options.length;Vi++){
		if(Varoptions.options[Vi].value==VarVale)return true;
	}
	return false;
}
function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}
function fucCheckLength(strTemp)
{
 var i,sum;
 sum=0;
	 for(i=0;i<strTemp.length;i++)
	 {
	  if ((strTemp.charCodeAt(i)>=0) && (strTemp.charCodeAt(i)<=255))
	   sum=sum+1;
	  else
	   sum=sum+2;
	 }
 return sum;
}
function IsInteger(str)     {       
	if(str.length!=0){    
		var reg=/^[-+]?\d*$/;     
		if(!reg.test(str)){    
			return false;
		}   
	}else{
		return false;
	}
  return true;
}
function IsEmail(str){
	if(str.length!=0){    
		var reg=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
		if(!reg.test(str)){    
			return false;
		}   
	}else{
		return false;
	}
  return true;
}
var imgObj;
function checkImg(theURL,winName){
  if (typeof(imgObj) == "object"){
    if ((imgObj.width != 0) && (imgObj.height != 0))
      OpenFullSizeWindow(theURL,winName, ",width=" + (imgObj.width+20) + ",height=" + (imgObj.height+30));
    else
      setTimeout("checkImg('" + theURL + "','" + winName + "')", 100)
  }
}

function OpenFullSizeWindow(theURL,winName,features) {
  var aNewWin, sBaseCmd;
  sBaseCmd = "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,";
  if (features == null || features == ""){
    imgObj = new Image();
    imgObj.src = theURL;
    checkImg(theURL, winName)
  }
  else{
    aNewWin = window.open(theURL,winName, sBaseCmd + features);
    aNewWin.focus();
  }
}
function getRadioChecked(str){
	var flag = 0;
	for (var i = 0; i < document.getElementsByName(str).length; i++){
		if (document.getElementsByName(str)[i].checked){
			++flag;
		}
	}
	return flag;
}

function NoCopy(){
	return false;
}
function EventAutoDefault(){
	document.write('向世界天才问好');
}
function EventAutoItem(cid){
	document.write('EventAutoItem='+cid);
}

function EventAutoNotice(cid){
	document.write('EventAutoNotice='+cid);
}
